//
//  HWBuySuccessGouMaiController.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/9/27.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWBuySuccessGouMaiController.h"

@interface HWBuySuccessGouMaiController ()
@property(weak,nonatomic) UIImageView *icoImageview;
@property(strong,nonatomic) UILabel *zhifucheLabel;
@end

@implementation HWBuySuccessGouMaiController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setUpcommonAttributes];
    [self setupUI];
}


// 设置常用的属性
- (void)setUpcommonAttributes {
    
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = @"购买成功";
    
    
}

// 设置UI
- (void)setupUI {
    
    UIView *icoView = [[UIView alloc]initWithFrame:CGRectMake(0, (kScreenH-(124+16+16+16+10+40))/2-50, kScreenW, 124+16+16+16+10+40)];
   // icoView.backgroundColor = [UIColor redColor];
    [self.view addSubview:icoView];
    
    UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake((kScreenW-124)/2,0, 124, 124)];
    imageview.image = [UIImage imageNamed:@"deal_success_zhangfhao"];
    [icoView addSubview:imageview];
    
    self.zhifucheLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, imageview.bottom, kScreenW, 16*3)];
    self.zhifucheLabel.text = @"您已支付成功";
    self.zhifucheLabel.textAlignment = NSTextAlignmentCenter;
    self.zhifucheLabel.font = [UIFont systemFontOfSize:16];
    [icoView addSubview:self.zhifucheLabel];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake((kScreenW-140)/2, self.zhifucheLabel.bottom+10, 140, 40);
    button.backgroundColor = RGB(26, 113, 255);
    [button addTarget:self action:@selector(buttonTap) forControlEvents:UIControlEventTouchUpInside];
    button.layer.cornerRadius = 6;
    [button  setTitle:@"确认" forState:UIControlStateNormal];
    button.layer.masksToBounds = YES;
    [icoView addSubview:button];

}

- (void)buttonTap  {
    
    
    [self.navigationController popToRootViewControllerAnimated:YES];

}

@end
